module.exports = function(grunt) {
	
	require('load-grunt-tasks')(grunt);
	
	grunt.initConfig({

		pkg: grunt.file.readJSON('package.json'),
		connect: {
			options: {
				port: 9001,
				hostname: "*",
				livereload: 35729
			},

			server: {
				options: {
					open: true,
					base: 'src'
				}
			}

		},

		watch: {
			livereload: {
				options: {
					livereload: '<%= connect.options.livereload %>'
				},
				files: ['src/*.html', 'src/js/*.js']
			},

			files: [
				'src/*.html',
				'src/js/*.js'
			]

		},

		clean: {
			dist: 'dist'
		},

		uglify: {
			dist: {
				options: {
					sourceMap: true,
					sourceMapName: 'dist/jquery-danger-confirm.map',
					banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */'
				},
				files: {
					'dist/jquery-danger-confirm.min.js' : ['src/js/jquery-danger-confirm.js']
				},
				tasks: ['clean']
			}
		},


	});

	grunt.registerTask('serve', ['connect:server', 'watch']);

}
